<template>
  <div class="entrance">
    <!--顶部大导航-->
    <entranceHead manageTitle="学校管理平台"></entranceHead>
    <div class="contentWrapper flex" >
      <div id="leftNav">
        <div  class="lefNav">
          <!--左边导航-->
          <entranceLeftNav :leftNav="leftNav" @leftNav="do_selectLeft($event)"></entranceLeftNav>
        </div>
      </div>
      <div class="rightTable flex1" >
        <div v-show="tableShow">
          <!--右边顶部导航-->
          <entranceRightNav :rightNav="rightNav" @do_rightNav="do_rightNav($event)" :rightNavFrom="rightNavFrom"></entranceRightNav>
          <!--右边表格-->
          <div class="overflowAuto">
            <!--<cityControl :cityData="cityData" v-if="leftNavIndex==0" @do_manage="do_manage($event)"></cityControl>-->
            <!--<xianControl :cityData="xianData" v-if="leftNavIndex==1" @do_manage="do_manage($event)"></xianControl>-->
            <!--<schoolControl :cityData="schoolData" v-if="leftNavIndex==2" @do_manage="do_manage($event)"></schoolControl>-->
            <resultControl :cityData="resultData" v-if="leftNavIndex==0" @do_manage="do_manage($event)"></resultControl>
            <ratControl :cityData="ratData" v-if="leftNavIndex==1"></ratControl>
          </div>

        </div>
        <div v-show="!tableShow">
          <addNewResult></addNewResult>
        </div>

      </div>


    </div>
    <!--新增和修改弹出框-->
    <selectUnit v-if="selectShow" @do_close="do_close($event)" :handleData="handleData"></selectUnit>
    <!--操作弹出框-->
    <manageHandle v-if="manageHandleShow&&manageHandleShow2" @do_closeManageHandle="do_closeManageHandle($event)" :handleFrom="handleFrom"></manageHandle>
    <!--弹出层-->
    <transition name="fade">
      <confirm
        :title=mistakeTitle
        confirm="确定"
        :msg=mistakeMsg
        @confirm1="def_mistake($event)"
        v-if="mistake"
      ></confirm>
    </transition>
    <transition name="fade">
      <makeSure
        :titleConfirm="titleConfirm"
        :msgConfirm='makeSureMsg'
        v-if="confirm"
        @sure="def_makeSure($event)"
        @giveUp="def_giveUp($event)"
      ></makeSure>
    </transition>
  </div>
</template>

<script>
  import entranceHead from '../commonEntrance/cm_entranceHead'
  import entranceLeftNav from '../commonEntrance/cm_entranceLeftNav'
  import entranceRightNav from '../commonEntrance/cm_entranceRightNav'
  import cityControl from '../commonEntrance/cm_cityControl'
  import xianControl from '../commonEntrance/cm_xianControl'
  import schoolControl from '../commonEntrance/cm_schoolControl'
  import resultControl from '../commonEntrance/cm_resultControl'
  import ratControl from '../commonEntrance/cm_ratControl'
  import selectUnit from '../commonEntrance/cm_selectUnit'
  import manageHandle from '../commonEntrance/cm_manageHandle'
  import addNewResult from '../commonEntrance/cm_addNewResult'
  import makeSure from '../../common/cm_makeSure'
  import confirm from '../../common/cm_confirm'
  export default {
    name: "yw_province",
    components:{
      entranceHead,//管理页面顶部导航
      entranceLeftNav,//管理页面左侧导航
      entranceRightNav,//管理页面右侧操作导航
      cityControl,//市州管理管理员维护
      xianControl,//区县管理员维护操作
      schoolControl,//学校管理员维护
      resultControl,//成果维护
      ratControl,//评价维护
      selectUnit,//右侧顶部新增与删除
      manageHandle,//管理员操作
      addNewResult,
      makeSure,
      confirm
    },
    data(){
      return{
        mistakeTitle:"错误",//弹出确认框
        mistake:false,
        mistakeMsg:'风口呢可能风能风口呢可能风呢可能',
        makeSureMsg:'风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能风口呢可能',//弹出选择模态框
        confirm:false,
        tableShow:true,
        rightNavFrom:'市州',
        selectShow:false,//选择新增与修改
        leftNavIndex:'0',
        // manageTitle:'省级管理平台'
        leftNav:[
          // {icon:'ren',title:'市州及操作员维护'},
          // {icon:'ren',title:'区县及操作员维护'},
          // {icon:'ren',title:'学校及操作员维护'},
          {icon:'CombinedShape',title:'成果库维护'},
          {icon:'pinglun',title:'评价维护'},
        ],
        rightNav:{
          title:'成果库维护',
          from:'市州',
          // leftLI:[
          //   {icon:"xinzeng",text:"新增",iconColor:'#37C872',iconSize:'16px'},
          //   {icon:"bianji",text:"修改",iconColor:'#FF8D1A',iconSize:'20px'},
          //   {icon:"shanchu",text:"删除",iconColor:'#FC6268',iconSize:'18px'},
          //   {icon:"excel",text:"导入Excel",iconColor:'#37C872',iconSize:'18px'},
          // ]
          rightLI:[{icon:"xinzeng",text:"新增",iconColor:'#37C872',iconSize:'16px'}]

        },

        /*学校表格数据*/
        resultData:{
          numText:'成果名称',
          title1:"所属单位",
          title2:"操作",
          title3:"完成人",
          title4:"课题来源",
          title5:"或将级别",
          title6:"学科学段",
          table:[
            {name:'小学生公民意识培养',school:'成都中学1',from:'全国教育改革‘十一五’规划',degree:'小学-自然',grade:'一等奖',person:["张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三"]},
            {name:'小学生公民意识培养',school:'成都中学2成都中学2',from:'全国教育改革‘十一五’规划',degree:'小学-自然',grade:'一等奖',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
            {name:'小学生公民意识培养',school:'成都中学3',from:'全国教育改革‘十一五’规划',degree:'小学-自然',grade:'一等奖',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
            {name:'小学生公民意识培养',school:'成都中学4',from:'全国教育改革‘十一五’规划',degree:'小学-自然',grade:'一等奖',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
            {name:'小学生公民意识培养',school:'成都中学5',from:'全国教育改革‘十一五’规划',degree:'小学-自然',grade:'一等奖',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
          ]
        },
        /*城市表格数据*/
        ratData:{
          numText:'被评价成果',
          title1:"评价内容",
          title2:"时间",
          table:[
            {num:1,city:'成都',person:["张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三","张三"]},
            {num:2,city:'成都1',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
            {num:3,city:'成都2',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
            {num:4,city:'成都3',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
            {num:5,city:'成都4',person:["张三","张三","张三","张三","张三","张三","张三","张三"]},
          ]
        },
        /*弹出新增与删除的组件数据*/
        handleData:{title:"学校维护", num:222,isCity:true, isQuXian:true},
        manageHandleShow:false,
        manageHandleShow2:true,
        handleFrom:''
      }
    },
    methods:{
      /*错误框函数*/
      def_mistake(){
        // alert(99)
        this.mistake=false
      },
      /*提醒选择框确认*/
      def_makeSure(){
        this.confirm=false
      },
      /*
      * 提醒选择框取消*/
      def_giveUp(){
        this.confirm=false
      },
      do_close(item){
        if(item=="关闭"){
          this.selectShow=false
          this.manageHandleShow2=true
        }

      },
      do_rightNav(item){

        switch (item2[0]){
          case "新增成果":
            // alert('新增成果')
            this.tableShow=false;
            break;
          case "批量删除":
            alert('批量删除')
            break;
        }
      },
      do_selectLeft(index){
        // alert(index)
        this.leftNavIndex=index

        if(index==0){

          this.rightNav={
            title:'成果库维护',
            leftLI:[
            ],
            rightLI:[{icon:"xinzeng",text:"新增成果",iconColor:'#37C872',iconSize:'16px'}]
          }
        }
        if(index==1){
          this.rightNav={
            title:'评价维护',
            leftLI:[
            ],
            rightLI:[{icon:"piliangshanchu",text:"批量删除",iconColor:'#FC6268',iconSize:'16px'}]

          }
        }
        this.tableShow=true;
      },
      do_manage(item){
        this.handleFrom=item
        switch (item){

          case "cg":
            // alert(item);
            this.tableShow=false;
            break

        }
      },
      do_closeManageHandle(item){
        let item2=item.split('-')
        switch (item2[0]) {
          case "save":
            alert("保存");
            break;
          case "close":
            this.manageHandleShow=false
            break;
          case "increase":
            this.selectShow=true
            this.manageHandleShow2=false
            switch (item2[1]) {
              case "cg":
                break;
            }
            break;
          case "delete":
            alert("删除")
            break;
          case "addExcel":
            alert("导入")
            break;
        }


      }
    }
  }
</script>

<style scoped>
  .entrance{
    min-width: 1200px;
  }
  .leftNav{
    width: 220px;
    min-height: 600px;
    background-color: white;
    position: absolute;
    top: 70px;
    left: 0;
    bottom: 0;
    box-shadow: 0 2px 10px 2px gainsboro;
  }
  .rightTable{
    padding: 0 20px 0 30px;
    /*overflow: hidden;*/
    /*border: 1px solid;*/
  }
  #leftNav{
    width: 220px;
  }
  .contentWrapper{

  }
</style>
